<template>
	<view class="frist-img" @click="bindClick">
		<view class="firstimgbox">
			<image :src="localurl+datalist.picture"  mode="widthFix"></image>
		</view>
	</view>
</template>

<script>
	import {common} from '@/common/publish.js';
	export default{
		props:{
			datalist:{
				type: Object
			},
			name:String,
		},
		data(){
			return{
				localurl:common.url
			}
		},
		methods:{
			bindClick(){
				uni.request({
					url:common.url+'/api/Frontiers/firstList.json',
					data:{
						relationid:this.datalist.id
					},
					success:(res)=>{
						console.log(res)
						if(res.statusCode == 200){
							if(res.data.total == 1){
								this.$emit('TurnThree',res.data.rows[0].id,this.datalist.title)
							}else{
								this.$emit('TurnTwo',this.datalist.id,this.datalist.picture,this.datalist.title)
							}
						}
					}
				})
				//
			}
		}
	}
</script>

<style lang="scss">
</style>
